Repository navigation
Optionally return the text around each tracked change - #64
Merged
Merged
Conversation
surroundingChars on listTrackedChanges/listReview adds before/after, so a caller can find a change again in an edited copy of the doc.
# Conflicts: # CHANGELOG.md
Owner
|
Thanks, merged. Since it is off by default, existing output and JSON stay the same. Ships in 0.17.0. |
aloth
added a commit
that referenced
this pull request
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm using olcli as a library to show tracked changes inside a local git clone of the project (a VS Code extension).
positiononly fits Overleaf's current copy of the doc. As soon as the local copy has edits the change doesn't know about, the offset is off, and there's nothing to find the change by. For a delete it's even worse, since the deleted text isn't in the file at all.Change
listTrackedChangesandlistReviewtakesurroundingChars. With it, each change carriesbeforeandafter: up to that many characters of the visible text right before the change and right after it (after the inserted text, for an insert). They come from the same visible textpositionrefers to, so history-ot docs work the same way. Off by default, soolcli changesoutput and JSON stay as they are.Tests
npm testgoes from 240 to 241. The new test covers an insert and a delete in a sharejs-text-ot doc and a delete in a history-ot doc, and checks that nothing is added without the option. Lint is unchanged. CHANGELOG entry included.What I haven't verified